Optimal. Leaf size=107 \[ \frac {1}{2} \left (2 a b B+a^2 C+2 b^2 C\right ) x+\frac {\left (2 a^2 B+3 b^2 B+6 a b C\right ) \sin (c+d x)}{3 d}+\frac {a (2 b B+a C) \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a^2 B \cos ^2(c+d x) \sin (c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.21, antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {4157, 4109,
4132, 2717, 4130, 8} \begin {gather*} \frac {\left (2 a^2 B+6 a b C+3 b^2 B\right ) \sin (c+d x)}{3 d}+\frac {1}{2} x \left (a^2 C+2 a b B+2 b^2 C\right )+\frac {a^2 B \sin (c+d x) \cos ^2(c+d x)}{3 d}+\frac {a (a C+2 b B) \sin (c+d x) \cos (c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2717
Rule 4109
Rule 4130
Rule 4132
Rule 4157
Rubi steps
\begin {align*} \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\int \cos ^3(c+d x) (a+b \sec (c+d x))^2 (B+C \sec (c+d x)) \, dx\\ &=\frac {a^2 B \cos ^2(c+d x) \sin (c+d x)}{3 d}-\frac {1}{3} \int \cos ^2(c+d x) \left (-3 a (2 b B+a C)+\left (\left (-2 a^2-3 b^2\right ) B-6 a b C\right ) \sec (c+d x)-3 b^2 C \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a^2 B \cos ^2(c+d x) \sin (c+d x)}{3 d}-\frac {1}{3} \int \cos ^2(c+d x) \left (-3 a (2 b B+a C)-3 b^2 C \sec ^2(c+d x)\right ) \, dx-\frac {1}{3} \left (-2 a^2 B-3 b^2 B-6 a b C\right ) \int \cos (c+d x) \, dx\\ &=\frac {\left (2 a^2 B+3 b^2 B+6 a b C\right ) \sin (c+d x)}{3 d}+\frac {a (2 b B+a C) \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a^2 B \cos ^2(c+d x) \sin (c+d x)}{3 d}-\frac {1}{2} \left (-2 a b B-a^2 C-2 b^2 C\right ) \int 1 \, dx\\ &=\frac {1}{2} \left (2 a b B+a^2 C+2 b^2 C\right ) x+\frac {\left (2 a^2 B+3 b^2 B+6 a b C\right ) \sin (c+d x)}{3 d}+\frac {a (2 b B+a C) \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a^2 B \cos ^2(c+d x) \sin (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.25, size = 90, normalized size = 0.84 \begin {gather*} \frac {6 \left (2 a b B+a^2 C+2 b^2 C\right ) (c+d x)+3 \left (3 a^2 B+4 b^2 B+8 a b C\right ) \sin (c+d x)+3 a (2 b B+a C) \sin (2 (c+d x))+a^2 B \sin (3 (c+d x))}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 114, normalized size = 1.07
method | result | size |
derivativedivides | \(\frac {\frac {a^{2} B \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+2 a b B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+b^{2} B \sin \left (d x +c \right )+2 a b C \sin \left (d x +c \right )+b^{2} C \left (d x +c \right )}{d}\) | \(114\) |
default | \(\frac {\frac {a^{2} B \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+2 a b B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+b^{2} B \sin \left (d x +c \right )+2 a b C \sin \left (d x +c \right )+b^{2} C \left (d x +c \right )}{d}\) | \(114\) |
risch | \(B a b x +\frac {x \,a^{2} C}{2}+x \,b^{2} C +\frac {3 a^{2} B \sin \left (d x +c \right )}{4 d}+\frac {\sin \left (d x +c \right ) b^{2} B}{d}+\frac {2 \sin \left (d x +c \right ) a b C}{d}+\frac {a^{2} B \sin \left (3 d x +3 c \right )}{12 d}+\frac {\sin \left (2 d x +2 c \right ) a b B}{2 d}+\frac {\sin \left (2 d x +2 c \right ) a^{2} C}{4 d}\) | \(116\) |
norman | \(\frac {\left (-a b B -\frac {1}{2} a^{2} C -b^{2} C \right ) x +\left (-3 a b B -\frac {3}{2} a^{2} C -3 b^{2} C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-3 a b B -\frac {3}{2} a^{2} C -3 b^{2} C \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-a b B -\frac {1}{2} a^{2} C -b^{2} C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (a b B +\frac {1}{2} a^{2} C +b^{2} C \right ) x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (a b B +\frac {1}{2} a^{2} C +b^{2} C \right ) x \left (\tan ^{14}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 a b B +\frac {3}{2} a^{2} C +3 b^{2} C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 a b B +\frac {3}{2} a^{2} C +3 b^{2} C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\left (2 a^{2} B -2 a b B +2 b^{2} B -a^{2} C +4 a b C \right ) \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (2 a^{2} B -6 a b B +18 b^{2} B -3 a^{2} C +36 a b C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {\left (2 a^{2} B +2 a b B +2 b^{2} B +a^{2} C +4 a b C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {\left (2 a^{2} B +6 a b B +18 b^{2} B +3 a^{2} C +36 a b C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {4 a \left (2 b B +a C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 a \left (4 B a -6 b B -3 a C \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {2 a \left (4 B a +6 b B +3 a C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}\) | \(527\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 108, normalized size = 1.01 \begin {gather*} -\frac {4 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a^{2} - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a^{2} - 6 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a b - 12 \, {\left (d x + c\right )} C b^{2} - 24 \, C a b \sin \left (d x + c\right ) - 12 \, B b^{2} \sin \left (d x + c\right )}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.52, size = 85, normalized size = 0.79 \begin {gather*} \frac {3 \, {\left (C a^{2} + 2 \, B a b + 2 \, C b^{2}\right )} d x + {\left (2 \, B a^{2} \cos \left (d x + c\right )^{2} + 4 \, B a^{2} + 12 \, C a b + 6 \, B b^{2} + 3 \, {\left (C a^{2} + 2 \, B a b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 254 vs.
\(2 (99) = 198\).
time = 0.50, size = 254, normalized size = 2.37 \begin {gather*} \frac {3 \, {\left (C a^{2} + 2 \, B a b + 2 \, C b^{2}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (6 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 4 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 12 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.73, size = 115, normalized size = 1.07 \begin {gather*} \frac {C\,a^2\,x}{2}+C\,b^2\,x+\frac {3\,B\,a^2\,\sin \left (c+d\,x\right )}{4\,d}+\frac {B\,b^2\,\sin \left (c+d\,x\right )}{d}+B\,a\,b\,x+\frac {B\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {C\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {2\,C\,a\,b\,\sin \left (c+d\,x\right )}{d}+\frac {B\,a\,b\,\sin \left (2\,c+2\,d\,x\right )}{2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________